import request from '@/utils/request'
import { ApiModulesRoutes } from '@/consts'

/**
 * 分页查询设备列表
 * @return {Promise<AxiosResponse<any>>}
 */
export const apiFindDevicesPagePyParam = async() => {
  const url = ApiModulesRoutes.IOT + '/device/findDeviceList'
  return request.get(url)
}

/**
 * 获取所有区域，用于映射选择场景，组织隔离
 * @return {Promise<AxiosResponse<any>>}
 */
export const apiGetAllArea = async () => {
  const url = ApiModulesRoutes.BASE + '/region/findRegionList'
  return request.get(url)
}

/**
 * 获取设备基本信息
 * @param {String} params.RobotID
 * @return {Promise<AxiosResponse<any>>}
 */
export const apiGetRobotBaseMsg = async (params) => {
  const url = ApiModulesRoutes.EXTERNAL + '/dadao/getRobotBaseMsg'
  return request.get(url,{ params })
}

/**
 * 获取设备基本信息
 * @param {String } params.deviceId
 * @return {Promise<AxiosResponse<any>>}
 */
export const apiFindDeviceById = async (params) => {
  const url = ApiModulesRoutes.IOT + '/device/findDeviceById'
  return request.get(url, { params })
}
